//
//  MJChiBaoZiFooter.m
//  MJRefreshExample
//
//  Created by MJ Lee on 15/6/12.
//  Copyright © 2015年 小码哥. All rights reserved.
//

#import "YJMJGifFooter.h"

@implementation YJMJGifFooter
#pragma mark - 重写方法
#pragma mark 基本设置
- (void)prepare
{
    [super prepare];
    
    // 设置正在刷新状态的动画图片
    // 设置普通状态的动画图片
    NSMutableArray *idleImages = [NSMutableArray array];
    for (NSUInteger i = 1; i<=8; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"load%zd", i]];
        [idleImages addObject:image];
    }
    [self setImages:idleImages duration:0.3 forState:MJRefreshStateIdle];
    
    // 设置正在刷新状态的动画图片
    NSMutableArray *refreshingImages = [NSMutableArray array];
    for (NSUInteger i = 1; i<=8; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"load%zd", i]];
        [refreshingImages addObject:image];
    }
    [self setImages:refreshingImages duration:0.3 forState:MJRefreshStateRefreshing];
    
    [self setTitle:@"到底了没有更多数据" forState:MJRefreshStateNoMoreData];
}
#pragma mark 监听控件的刷新状态
- (void)setState:(MJRefreshState)state
{
    MJRefreshCheckState;
    
    switch (state) {
        case MJRefreshStateIdle:
            
            break;
        case MJRefreshStatePulling:
            
            break;
        case MJRefreshStateRefreshing:
            
            break;
        case MJRefreshStateNoMoreData:{
             [self setTitle:@"到底了没有更多数据" forState:MJRefreshStateNoMoreData];
        }
        default:
            break;
    }
}
@end
